import { InstallListComponent } from './install/install-list/install-list.component';
import { InstallComponent } from './install/install.component';
import { CustomerComponent } from './customer/customer.component';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import {OrderComponent} from './order/order.component';
import {OrderAddComponent} from './order/order-add/order-add.component';
import {OrderEditComponent} from './order/order-edit/order-edit.component';
import {LoginComponent} from './login/login.component';
import {OrderListComponent} from "./order/order-list/order-list.component";
import {MaterialComponent} from './material/material.component';
import {MaterialListComponent} from './material/material-list/material-list.component';
import { CustomerListComponent } from './customer/customer-list/customer-list.component';

const routes: Routes = [
  { path: '', redirectTo: '/order', pathMatch: 'full'},
  { path: 'order', component: OrderComponent,
    children: [
      {path: 'add', component: OrderAddComponent },
      {path: 'edit', component: OrderEditComponent },
      {path: 'list', component: OrderListComponent }]
  },
  { path: 'material', component: MaterialComponent,
    children: [
      {path: 'list', component: MaterialListComponent}
    ]},
  { path: 'customer', component: CustomerComponent,
    children: [
      {path: 'list', component: CustomerListComponent}
    ]},
  { path: 'install', component: InstallComponent,
    children: [
      {path: 'list', component: InstallListComponent}
    ]},
  { path: 'login', component: LoginComponent}
];

@NgModule({
  imports: [
    CommonModule,
    RouterModule.forRoot(routes)
  ],
  exports: [
    RouterModule
  ],
  declarations: []
})
export class AppRoutingModule { }


